<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>添加</title>
    <#assign base=request.contextPath  />
    <base id="base" href="${base}">
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, adminUser-scalable=0">
    <link rel="stylesheet" href="${base}/static/win10/component/layui/css/layui.css" media="all">
    <script>
        var base =  "${base}";
    </script>
</head>
<body>
<br>
<form class="layui-form " action="">
          <div class="layui-form-item">
              <label class="layui-form-label">附件ID</label>
              <div class="layui-input-block">
                  <@enclosure_tag>
                      <select name="enclosureId" lay-filter="enclosureId" id="enclosureId">
                          <option value="">请选择</option>
                          <#if enclosureList?? && enclosureList?size gt 0>
                              <#list enclosureList as dict>
                                  <option value="${dict.enclosureId}">${dict.enclosureUrl}</option>
                              </#list>
                          </#if>
                      </select>
                  </@enclosure_tag>
              </div>
          </div>
          <div class="layui-form-item">
              <label class="layui-form-label">简历ID</label>
              <div class="layui-input-block">
                  <@resume_tag>
                      <select name="resumeId" lay-filter="resumeId" id="resumeId">
                          <option value="">请选择</option>
                          <#if resumeList?? && resumeList?size gt 0>
                              <#list resumeList as dict>
                                  <option value="${dict.resumeId}">${dict.resumeId}</option>
                              </#list>
                          </#if>
                      </select>
                  </@resume_tag>
              </div>
          </div>
          <div class="layui-form-item">
                <label class="layui-form-label">选择用户</label>
                <div class="layui-input-block">
                    <@personal_tag >
                        <select name="personalId" lay-filter="personalId" id="personalId">
                            <option value="">请选择</option>
                            <#if personalList?? && personalList?size gt 0>
                                <#list personalList as dict>
                                    <option value="${dict.personalId}">${dict.personalName}</option>
                                </#list>
                            </#if>
                        </select>
                    </@personal_tag>
                </div>
          </div>
          <div class="layui-form-item">
            <label class="layui-form-label">选择发布的职位</label>
            <div class="layui-input-block">
                <@position_tag >
                    <select name="positionId" lay-filter="positionId" id="positionId">
                        <option value="">请选择</option>
                        <#if positionList?? && positionList?size gt 0>
                            <#list positionList as dict>
                                <option value="${dict.positionId}">
                                    <@industry_tag value="${dict.positionIndustryId}">
                                        ${industry.industryName}
                                    </@industry_tag>
                                </option>
                            </#list>
                        </#if>
                    </select>
                </@position_tag>
            </div>
          </div>


    <div align="center">
        <button type="button" class="layui-btn" id="submit">保存</button>
    </div>
</form>

<script src="${base}/static/win10/component/layui/layui.js?t=1"></script>
<script src="${base}/static/win10/js/jquery-1.8.3.min.js?t=1"></script>
<script>
    layui.use(['form', 'layer'], function() {
        var form = layui.form
                , layer = layui.layer;
        $("#submit").on("click",function () {
            if(check()===false){
                return;
            }

            var formDate = {
                         enclosureId:$("#enclosureId").val(),
                         resumeId:$("#resumeId").val(),
                personalId:$("#personalId").val(),
                positionId:$("#positionId").val()
            }
            $.ajax({
                type: "POST",
                url: base+"/WeChatUser/wechatJobApplication/admin/addWechatJobApplication",
                data: formDate,
                success: function (data) {
                    layer.msg(data.message)
                    if (data.code === 200) {
                        window.location.href=base+"/WeChatUser/wechatJobApplication/admin/main.html"
                    } else {

                    }
                }
            });
        })







        function check(){
                   if($("#enclosureId").val().length<1){
                       layer.msg("请输入附件ID");
                       return false;
                   }
                   if($("#resumeId").val().length<1){
                       layer.msg("请输入简历ID");
                       return false;
                   }
        }
    });

</script>
</body>
</html>